﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using AI;
using FarseerPhysics.Dynamics;
using MapLibrary.Players;
using Microsoft.Xna.Framework;

namespace MapLibrary.AILibrary
{
    public class ProteinBot : Bot
    {

        public override void Update(Level level, World world)
        {
            base.Update(level, world);

            //get player
            Player p = Owner.World.CurrentLevel.Player;

            Vector2 direction = p.Body.Position - Owner.Body.Position;
            Vector2 dFinal = Vector2.Normalize(direction);
            //dFinal *= 0.10f;
            dFinal *= 10.0f;

            //Owner.Body.ApplyLinearImpulse(dFinal);
            Owner.Body.LinearVelocity = dFinal;
        }
    }
}
